/* __auth__ : KunLin */

package com.cskaoyan.utils;

public class CommonUtil {

    public static boolean objectIsEmpty (Object o){
        if (o == null){
            return true;
        }
        if (o instanceof String){
            return "".equals(o);
        }
        return false;
    }

    public static String splitUrlResource(String url) {
        if (url != null && !"".equals(url)) {
            // URL的判断
            if (url.matches("(http|https):\\/\\/[\\w\\-_]+(\\.[\\w\\-_]+)+([\\w\\-\\.,@?^=%&:/~\\+#]*[\\w\\-\\@?^=%&/~\\+#])?")) {
                String[] urls = url.split("^(http|https)://.*?/+?");
                if (urls.length == 2) {
                    return urls[1];
                }
            }
        }
        return url;
    }
}
